
package com.gzbsoft.sc.modules.sys.dao;
import com.gzbsoft.sc.modules.sys.entity.SysConfig;
import org.springframework.data.ebean.annotation.Modifying;
import org.springframework.data.ebean.annotation.Query;
import org.springframework.data.ebean.repository.EbeanRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
/**
 * 系统配置信息
 *
 * @author Mark sunlightcs@gmail.com
 */
@Repository
public interface SysConfigDao extends EbeanRepository<SysConfig, Long> {
    /**
     * 根据key，查询value
     */
    @Query("select * from sys_config where param_key = :paramKey")
    SysConfig queryByKey(String paramKey);
    /**
     * 根据key，更新value
     */
    @Query(nativeQuery = true, value = "update sys_config set param_value = :paramValue where param_key =: paramKey")
    @Modifying
    int updateValueByKey(@Param("paramKey") String paramKey, @Param("paramValue") String paramValue);
}
